package org.example.what_mall.vo;

import lombok.Data;
import org.example.what_mall.entity.Goods;

@Data
public class GoodsVO {
    private Integer id;
    private String name;
    private Integer price;
    private String img;

    public static GoodsVO of(Goods goods, Integer price) {
        GoodsVO goodsVO = new GoodsVO();
        goodsVO.setId(goods.getId());
        goodsVO.setName(goods.getName());
        goodsVO.setPrice(price);
        goodsVO.setImg(goods.getImg());
        return goodsVO;
    }
}
